Component({
  properties: {
    course: {
      type: Object,
      value: {}
    }
  },
  methods: {
    onTap() {
      console.log('course-card点击，课程数据:', this.data.course)
      if (this.data.course && this.data.course.id) {
        this.triggerEvent('tap', {
          course: this.data.course
        })
      } else {
        console.error('course-card: 课程数据无效', this.data.course)
        wx.showToast({
          title: '课程数据错误',
          icon: 'none'
        })
      }
    }
  }
})
